﻿@model Zor_Web.Models.Base.V_Zor_Invoice
@using Webdiyer.WebControls.Mvc;
@using Zor_Tools;
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>发票号管理列表</title>
    <link href="~/Content/LayerUI/src/css/layui.css" rel="stylesheet" />
    <link href="~/Content/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/Styles/zor.css" rel="stylesheet" />
    <!-- 框架必要 -->
    <script src="~/Content/Scripts/jquery/jquery-1.9.1.min.js"></script>
    <script src="~/Content/Scripts/learunui-framework.js"></script>
    <script src="~/Content/Scripts/Zor_AJax.js"></script>
    <!-- 消息提示 -->
    <script language='javascript' src='~/Content/layer/layer.js'></script>
    <!-- 日期选择器 -->
    <script src="~/Content/laydate/laydate.js"></script>
    <!-- 表单验证 -->
    <script src="~/Content/Scripts/JValidator.js"></script>
    <!-- 打印单样式 -->
    <style type="text/css">
        .p1 {
            /*font-size: 12px;*/
            font: 12px '新宋体';
        }

        #In_Number_s {
            position: absolute;
            top: 415px;
            left: 390px;
        }

        .In_Numberx {
            /*font-size: 12px;*/
            font: 25px '微软雅黑';
            color: #FF5722;
        }
    </style>

</head>
<body class="gray-bg">
    <div class="layui-tab layui-tab-brief main-tab-container ">
        <div class="col-sm-12 ct-padding">
            <div class="col-sm-8 ct-padding">
                <button id="btnInvoice" class="layui-btn layui-btn layui-btn-small"><span class="glyphicon glyphicon-plus"></span> 录入发票号</button>
                <button id="btnUpdate" class="layui-btn layui-btn-warm layui-btn-small"><span class="glyphicon glyphicon-pencil"></span> 编辑</button>
                <button id="btnPrint" class="layui-btn  layui-btn-steelblue  layui-btn-small"><span class="glyphicon glyphicon-print"></span>打印</button>
                <button id="btnSearchFull" class="layui-btn  layui-btn-normal layui-btn-small"><span class="glyphicon glyphicon-search"></span>查询</button>
                <button id="btnMessage" class="layui-btn layui-btn-orchid layui-btn-small"><span class="glyphicon glyphicon-list-alt"></span>详情</button>
                <button id="btnRefresh" class="layui-btn layui-btn-blue layui-btn-small"><span class="glyphicon glyphicon-repeat"></span>刷新</button>
            </div>
        </div>

        <div class="col-sm-12  layui-tab-content">
            <div class="mail-box" style="overflow-x:scroll;white-space:nowrap;">
                <table class="layui-table" lay-skin="line">
                    <thead>
                        <tr>
                            <th hidden></th>
                            <th></th>
                            <th>受理单号</th>
                            <th>付款人</th>
                            <th>纳税人</th>
                            <th>联系方式</th>
                            <th>面积</th>
                            <th>租金</th>
                            <th>完税证号</th>
                            <th>税金</th>
                            <th>发票编号</th>
                            <th>缴税时间</th>
                            <th>开票人</th>
                            <th>受理状态</th>
                        </tr>
                    </thead>
                    <tbody id="accordion">
                        @foreach (var item in Model.PageData)
                {
                            <tr>

                                <td hidden>@item.In_Id</td>
                                <td><input type="radio" name="chk" id="@item.In_Id" value="@item.In_Id" /></td>
                                <td>@item.Acceptance_TicketNumber</td>
                                <td>@item.Tenant_Name</td>
                                <td>@item.NatPer_Name</td>
                                <td>@item.NatPer_Phone</td>
                                <td>@item.Hs_Proportion</td>
                                <td>@(item.EReviewRent*0.01)</td>
                                <td>@item.Pt_CertificateNumber</td>
                                <td>@(item.ETax*0.01)</td>
                                <td>@item.In_Number</td>
                                @if (@item.In_Date != 0)
                        {
                                    <td>@TimeHelper.TimeStampToDateTime(item.In_Date.ToString(), TimeHelper.ToTimeType.link_ymd)</td>}
                        else
                        {
                                    <td>未缴税</td> }
                                <td>@item.User_RealName</td>
                                @if (@item.InState == "未开发票")
                        {

                                    <td><span class='label label-warning pull-center'>@item.InState</span></td>
                        }
                        else
                        {
                                    <td>@item.InState</td>
                        }
                                <td hidden>@item.Acceptance_Id</td>
                                <td hidden>@item.CommunityName</td>
                                <td hidden>@item.NatPer_IDNumber</td>
                                <td hidden>@item.Acceptance_TaxNumber</td>
                                <td hidden>@(item.ReviewRent*0.01)</td>
                                <td hidden>@item.Csqx</td>
                                <td hidden>@item.AHA</td>
                                <td hidden>@item.Acceptance_Address</td>
                                <td hidden>@TimeHelper.TimeStampToDateTime(item.Review_Date.ToString(), TimeHelper.ToTimeType.link_ymd)</td>
                                <td hidden>@TimeHelper.TimeStampToDateTime(item.Lease_StartTime.ToString(), TimeHelper.ToTimeType.link_ymd)</td>
                                <td hidden>@TimeHelper.TimeStampToDateTime(item.Lease_EndTime.ToString(), TimeHelper.ToTimeType.link_ymd)</td>
                                <td hidden>@TimeHelper.TimeStampToDateTime(item.Acceptance_TaxStartTime.ToString(), TimeHelper.ToTimeType.link_ymd)</td>
                                <td hidden>@TimeHelper.TimeStampToDateTime(item.Acceptance_TaxEndTime.ToString(), TimeHelper.ToTimeType.link_ymd)</td>
                                <td hidden>@item.Hs_attribute</td>
                                <td hidden>@item.Hs_Cqsx</td>
                                <td hidden>@(item.leaseRent*0.01)</td>
                                <td hidden>@(item.EPropertyTax*0.01)</td>
                                <td hidden>@(item.EPersonalTax*0.01)</td>
                                <td hidden>@(item.ETotalTax*0.01)</td>
                                <td hidden>@item.Review_Comment</td>
                                <td hidden>@item.ReviewUser</td>
                                <td hidden>@TimeHelper.TimeStampToDateTime(item.Evaluate_Date.ToString(), TimeHelper.ToTimeType.link_ymd)</td>
                                <td hidden>@item.Evaluate_Comment</td>
                                <td hidden>@item.Examine_Comment</td>
                                <td hidden>@item.EvaluateUser</td>
                                <td hidden>@TimeHelper.TimeStampToDateTime(item.Examine_Date.ToString(), TimeHelper.ToTimeType.link_ymd)</td>
                                <td hidden>@item.ExamineUser</td>
                                <td hidden>@(item.PtActualTax*0.01)</td>
                                <td hidden>@item.Pt_Id</td>
                                <td hidden>@item.Pt_Date</td>
                                <td hidden>@item.InUser</td>
                            </tr>
                }
                    </tbody>
                </table>
                <div class="col-sm-12">
                    <div class="col-sm-10">
                        @Html.Pager(Model.PageData, new PagerOptions { PageIndexParameterName = "index", ContainerTagName = "ul", PrevPageText = "上页", NextPageText = "下页", FirstPageText = "首页", LastPageText = "尾页", CssClass = "pagination", PagerItemsSeperator = "", CurrentPagerItemWrapperFormatString = "<li class=\"active\"><a href=\"#\">{0}</a></li>", PagerItemWrapperFormatString = "<li>{0}</li>" }, new { id = "bootstrappager", @class = "pagination" })
                    </div>
                    <div class="col-sm-2 to-righjt">
                        共 @Model.PageData.TotalItemCount 条记录，页 @Model.PageData.CurrentPageIndex/@Model.PageData.TotalPageCount
                    </div>
                </div>
            </div>
        </div>
    </div>      
    
             <!-- 打印模态 -->
            <div hidden class="content">
                <div id="modalPrint">
                    <p class="p1">
                        <label id="In_Number_s"></label>
                    </p>

                </div>
            </div>

            <!-- 模态 -->
            <div id="myModal" hidden data-backdrop="static">
                <div id="divfrom" class="layui-tab-content">
                    <form method="get" class="form-horizontal m-t">
                        <div class="layui-form-item" hidden>
                            <label class="col-sm-3 layui-form-label">Id：</label>
                            <div class="col-sm-9">
                                <input id="In_Id" type="text" class="form-control">

                            </div>
                        </div>
                        <div class="layui-form-item" id="divAt_StreetName">
                            <label class="col-sm-2 layui-form-label">
                                <nobr>发票号码：</nobr>
                            </label>
                            <div class="col-sm-10">
                                <input id="In_Number" type="text" class="form-control" placeholder="请输入发票号码" autofocus="autofocus">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="col-sm-2 layui-form-label">业主姓名：</label>
                            <div class="col-sm-4">
                                <input id="NatPer_Name" type="text" class="form-control" readonly="readonly">
                            </div>
                            <label class="col-sm-2 layui-form-label">付款人：</label>
                            <div class="col-sm-4">
                                <input id="Tenant_Name" type="text" class="form-control" readonly="readonly">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="col-sm-2 layui-form-label">房屋面积(㎡)：</label>
                            <div class="col-sm-4">
                                <input id="Hs_Proportion" type="text" class="form-control" readonly="readonly">
                            </div>
                            <label class="col-sm-2 layui-form-label">租金（元）：</label>
                            <div class="col-sm-4">
                                <input id="Evaluate_Rent" type="text" class="form-control" readonly="readonly">
                            </div>

                        </div>
                        <div class="layui-form-item">
                            <label class="col-sm-2 layui-form-label">租赁起始时间：</label>
                            <div class="col-sm-4">
                                <input id="Lease_StartTime" type="text" class="laydate-icon  form-control layer-date" readonly="readonly">
                            </div>
                            <label class="col-sm-2 layui-form-label">租赁结束时间：</label>
                            <div class="col-sm-4">
                                <input id="Lease_EndTime" type="text" class="laydate-icon form-control layer-date" readonly="readonly">
                            </div>

                        </div>
                    </form>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <div class=" box-footer">
                            <button id="btnSure" class="btn btn-info pull-right">
                                <i class="fa fa-check"></i>提交
                            </button>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 编辑模态 -->
            <div id="myModalUp" hidden data-backdrop="static">
                <div id="divfrom" class="layui-tab-content">
                    <form method="get" class="form-horizontal m-t">
                        <div class="layui-form-item" id="divAt_StreetName">
                            <label class="col-sm-2 layui-form-label">
                                <nobr>发票号码：</nobr>
                            </label>
                            <div class="col-sm-10">
                                <input id="In_Numbers" type="text" class="form-control" placeholder="请输入发票号码" autofocus="autofocus">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="col-sm-2 layui-form-label">业主姓名：</label>
                            <div class="col-sm-4">
                                <input id="NatPer_Names" type="text" class="form-control" readonly="readonly">
                            </div>
                            <label class="col-sm-2 layui-form-label">付款人：</label>
                            <div class="col-sm-4">
                                <input id="Tenant_Names" type="text" class="form-control" readonly="readonly">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="col-sm-2 layui-form-label">房屋面积(㎡)：</label>
                            <div class="col-sm-4">
                                <input id="Hs_Proportions" type="text" class="form-control" readonly="readonly">
                            </div>
                            <label class="col-sm-2 layui-form-label">租金（元）：</label>
                            <div class="col-sm-4">
                                <input id="Evaluate_Rents" type="text" class="form-control" readonly="readonly">
                            </div>

                        </div>
                        <div class="layui-form-item">
                            <label class="col-sm-2 layui-form-label">租赁起始时间：</label>
                            <div class="col-sm-4">
                                <input id="Lease_StartTimes" type="text" class="laydate-icon  form-control layer-date" readonly="readonly">
                            </div>
                            <label class="col-sm-2 layui-form-label">租赁结束时间：</label>
                            <div class="col-sm-4">
                                <input id="Lease_EndTimes" type="text" class="laydate-icon form-control layer-date" readonly="readonly">
                            </div>

                        </div>
                    </form>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <div class="box-footer">
                            <button id="btnSureUp" class="btn btn-info pull-right">
                                <i class="fa fa-check"></i>提交
                            </button>
                        </div>
                    </div>
                </div>
            </div>

            @using (Html.BeginForm("Zor_Invoice", "Base", new RouteValueDictionary { { "Model", Model } }, FormMethod.Get))
            {
    <!-- 查询模态框 -->
                <div id="myModalSearch" hidden data-backdrop="static">
                    <div id="divfrom" class="layui-tab-content">
                        <form method="get" class="form-horizontal m-t">
                            <div class="layui-form-item">
                                <label class="col-sm-2 layui-form-label">发票号起始时间：</label>
                                <div class="col-sm-4">
                                    <input id="Search_StartTime" name="In_Date" type="text" class="laydate-icon  form-control layer-date" value="@Model.In_Date">
                                </div>
                                <label class="col-sm-2 layui-form-label">发票号结束时间：</label>
                                <div class="col-sm-4">
                                    <input id="Search_EndTime" name="In_Date" type="text" class="laydate-icon form-control layer-date" value="@Model.In_Date">
                                </div>

                            </div>

                            <div class="layui-form-item">
                                <label class="col-sm-2 layui-form-label">业主姓名：</label>
                                <div class="col-sm-4">
                                    <input name="NatPer_Name" type="text" class="form-control" value="@Model.NatPer_Name">
                                </div>
                                <label class="col-sm-2 layui-form-label">业主联系电话：</label>
                                <div class="col-sm-4">
                                    <input name="NatPer_Phone" type="text" class="form-control" value="@Model.NatPer_Phone">
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="col-sm-2 layui-form-label f12">业主身份证号：</label>
                                <div class="col-sm-4">
                                    <input name="NatPer_IDNumber" type="text" class="form-control" value="@Model.NatPer_IDNumber">
                                </div>
                                <label class="col-sm-2 layui-form-label">税号：</label>
                                <div class="col-sm-4">
                                    <input name="Acceptance_TaxNumber" type="text" class="form-control" value="@Model.Acceptance_TaxNumber">
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="col-sm-2 layui-form-label">付款人/单位：</label>
                                <div class="col-sm-4">
                                    <input name="Tenant_Name" type="text" class="form-control" value="@Model.Tenant_Name">
                                </div>
                                <label class="col-sm-2 layui-form-label">受理单号：</label>
                                <div class="col-sm-4">
                                    <input type="text" class="form-control" name="Acceptance_TicketNumber" value="@Model.Acceptance_TicketNumber">
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="col-sm-2 layui-form-label">受理状态：</label>
                                <div class="col-sm-4">
                                    <select name="InState" class="form-control">
                                        <option value="全部">全部</option>
                                        <option value="@Model.InState">未开发票</option>
                                        <option value="@Model.InState">已开发票</option>
                                        <option value="@Model.InState">已打印发票</option>
                                    </select>
                                </div>
                                <label class="col-sm-2 layui-form-label">发起类型：</label>
                                <div class="col-sm-4">
                                    <select name="AcceptanceType" class="form-control">
                                        <option value="全部">全部</option>
                                        <option value="@Model.AcceptanceType">社区</option>
                                        <option value="@Model.AcceptanceType">自然人</option>
                                    </select>
                                </div>
                            </div>

                        </form>
                        <div class="box-footer">
                            <button type="submit" class="layui-btn layui-btn-normal layui-btn-small pull-right">
                                <i class="fa fa-search"></i>查询
                            </button>
                        </div>
                    </div>
                </div>
            }
            <!-- 详情模态 -->
            <div id="myModalDetails" hidden data-backdrop="static">
                <div id="divfrom" class="layui-tab-content">

                    <div class="layui-form-item">
                        <label class="col-sm-2 layui-form-label">地址：</label>
                        <div class="col-sm-10 layui-input" id="Acceptance_AddressD"> </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="col-sm-2 layui-form-label">受理单号：</label>
                        <div class="col-sm-2 layui-input" id="Acceptance_TicketNumberD"></div>
                        <label class="col-sm-2 layui-form-label">业主姓名：</label>
                        <div class="col-sm-2 layui-input" id="NatPer_NameD"> </div>
                        <label class="col-sm-2 layui-form-label">业主联系电话：</label>
                        <div class="col-sm-2 layui-input" id="NatPer_PhoneD"></div>
                    </div>

                    <div class="layui-form-item">
                        <label class="col-sm-2 layui-form-label">业主身份证号：</label>
                        <div class="col-sm-2 layui-input" id="NatPer_IDNumberD"> </div>
                        <label class="col-sm-2 layui-form-label">所属社区：</label>
                        <div class="col-sm-2 layui-input" id="CommunityNameD"> </div>
                        <label class="col-sm-2 layui-form-label">完税证号：</label>
                        <div class="col-sm-2 layui-input" id="Pt_CertificateNumberD"> </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="col-sm-2 layui-form-label">租赁起始时间：</label>
                        <div class="col-sm-4 layui-input laydate-icon layer-date" id="Lease_StartTimeD"></div>
                        <label class="col-sm-2 layui-form-label">租赁结束时间：</label>
                        <div class="col-sm-4 layui-input laydate-icon layer-date" id="Lease_EndTimeD"></div>
                    </div>

                    <div class="layui-form-item" id="TaxEndTime">
                        <label class="col-sm-2 layui-form-label">税收起始时间：</label>
                        <div class="col-sm-4 layui-input laydate-icon layer-date" id="Acceptance_TaxStartTimeD"> </div>
                        <label class="col-sm-2 layui-form-label">税收结束时间：</label>
                        <div class="col-sm-4 layui-input laydate-icon layer-date" id="Acceptance_TaxEndTimeD"> </div>
                    </div>

                    <div class="layui-form-item" id="TaxEndTime">
                        <label class="col-sm-2 layui-form-label">发票号：</label>
                        <div class="col-sm-2 layui-input" id="In_NumberD"></div>
                        <label class="col-sm-2 layui-form-label">税号：</label>
                        <div class="col-sm-2 layui-input" id="Acceptance_TaxNumberD"></div>
                        <label class="col-sm-2 layui-form-label">付款人/单位：</label>
                        <div class="col-sm-2 layui-input" id="Tenant_NameD"></div>
                    </div>

                    <div class="layui-form-item">
                        <label class="col-sm-2 layui-form-label">房屋面积(㎡)：</label>
                        <div class="col-sm-2 layui-input" id="Hs_ProportionD"></div>
                        <label class="col-sm-2 layui-form-label">初始租金（元）：</label>
                        <div class="col-sm-2 layui-input" id="Lease_RentD"></div>
                        <label class="col-sm-2 layui-form-label">计税总额：</label>
                        <div class="col-sm-2 layui-input" id="Evaluate_TotalTaxD"> </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="col-sm-2 layui-form-label">
                            <nobr>产权属性：</nobr>
                        </label>
                        <div class="col-sm-4">
                            <select name="temp" class="form-control" id="Hs_CqsxD" disabled>
                                <option value="1">个人</option>
                                <option value="2">公用</option>
                            </select>
                        </div>
                        <label class="col-sm-2 layui-form-label">
                            <nobr>房屋属性：</nobr>
                        </label>
                        <div class="col-sm-4">
                            <select name="temp" class="form-control" id="Hs_attributeD" disabled>
                                <option value="1">住宅</option>
                                <option value="2">非住宅</option>
                            </select>
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label class="col-sm-2 layui-form-label">评议租金：</label>
                        <div class="col-sm-2 layui-input" id="Review_RentD"></div>
                        <label class="col-sm-2 layui-form-label">评议人：</label>
                        <div class="col-sm-2 layui-input" id="ReviewUserD"> </div>
                        <label class="col-sm-2 layui-form-label">评议时间：</label>
                        <div class="col-sm-2 layui-input" id="Review_DateD"> </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="col-sm-2 layui-form-label">房产税：</label>
                        <div class="col-sm-2 layui-input" id="Evaluate_PropertyTaxD"> </div>
                        <label class="col-sm-2 layui-form-label">个人所得税：</label>
                        <div class="col-sm-2 layui-input" id="Evaluate_PersonalTaxD"> </div>
                        <label class="col-sm-2 layui-form-label">税金：</label>
                        <div class="col-sm-2 layui-input" id="Evaluate_TaxD"> </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="col-sm-2 layui-form-label">评议意见：</label>
                        <div class="col-sm-10 layui-input" id="Review_CommentD"> </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="col-sm-2 layui-form-label">评定租金：</label>
                        <div class="col-sm-2 layui-input" id="Evaluate_RentD"> </div>
                        <label class="col-sm-2 layui-form-label">评定人：</label>
                        <div class="col-sm-2 layui-input" id="EvaluateUserD"> </div>
                        <label class="col-sm-2 layui-form-label">评定时间：</label>
                        <div class="col-sm-2 layui-input" id="Evaluate_DateD"> </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="col-sm-2 layui-form-label">评定意见：</label>
                        <div class="col-sm-10 layui-input" id="Evaluate_CommentD"> </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="col-sm-2 layui-form-label">审核人：</label>
                        <div class="col-sm-4 layui-input" id="ExamineUserD"></div>
                        <label class="col-sm-2 layui-form-label">审核时间：</label>
                        <div class="col-sm-4 layui-input" id="Examine_DateD"></div>
                    </div>

                    <div class="layui-form-item">
                        <label class="col-sm-2 layui-form-label">审核意见：</label>
                        <div class="col-sm-10 layui-input" id="Examine_CommentD"> </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="col-sm-2 layui-form-label">应收税款：</label>
                        <div class="col-sm-2 layui-input" id="Pt_ActualTaxD"> </div>
                        <label class="col-sm-2 layui-form-label">操作人：</label>
                        <div class="col-sm-2 layui-input" id="PtUserD"></div>
                        <label class="col-sm-2 layui-form-label">操作时间：</label>
                        <div class="col-sm-2 layui-input" id="Pt_DateD"></div>
                    </div>

                    <div class="layui-form-item">
                        <label class="col-sm-2 layui-form-label">开票人：</label>
                        <div class="col-sm-2 layui-input" id="InUser"></div>
                        <label class="col-sm-2 layui-form-label">开票时间：</label>
                        <div class="col-sm-2 layui-input" id="In_Date"></div>
                    </div>
                </div>
            </div>

            <div hidden class="content">
                <div id="modalPrint">
                    <p class="p5" align="right">
                        <label class="label2" id="Hs_attribute2"></label>
                    </p>
                </div>
            </div>
</body>
</html>



<script>
    /*
  * 打印
  */

    $(function () {
        $("#btnPrint").click(function () {
            var In_Number = getTableCell(10);
            var In_Id = CheckboxValueIDs(); //获取单选按钮的值
            if (In_Id.length == 0) {
                layer.msg("请选择要打印的信息！");                                                             //未选中任何行
                return;
            }
            if (In_Id.length > 1) {
                layer.msg("只能选择一条信息");                                                             //未选中任何行
                return;
            }
            if (In_Number == "") {
                layer.msg("请先录入发票号，再进行打印！");
                return;

            } else {
                var In_Number = getTableCell(10);
                layer.confirm("请核对发票编号，确认是否打印? <p align='center' class='In_Numberx'>" + In_Number + "</p> ", { icon: 3, btn: ['确定', '取消'] }, function () {
                    GetPrintArea(In_Id);
                    document.body.innerHTML = document.getElementById('modalPrint').innerHTML;//填充打印区域
                    window.print();//打印
                    Replace();//刷新
                })
            }
        })
    })

    /**
       *打印取值
       */
    function GetPrintArea(In_Id) {
        var html = "";
        $("#In_Number_s").html(getTableCell(10));  
    }


    /**
   *   日期选择器---查询租赁日期
   */
    laydate.skin('molv');         //日历皮肤
    var startS = {                   //开始时间选择
        elem: "#Search_StartTime",
        format: "YYYY/MM/DD",
        min: '1900-01-01',
        max: "2099-06-16",
        istime: false,
        istoday: true,
        choose: function (datas) {
            end.min = datas;
            end.start = datas
        }
    };
    var endS = {                     //结束时间选择
        elem: "#Search_EndTime",
        format: "YYYY/MM/DD",
        min: '1900-01-01',
        max: "2099-06-16",
        istime: false,
        istoday: true,
        choose: function (datas) { start.max = datas }
    };
    laydate(startS);
    laydate(endS);

    /** 刷新**/

    $(function () {
        $("#btnRefresh").click(function () {
            Replace();
        })
    })

    /*查询*/

    $("#btnSearchFull").click(function () {
        LayerOpen('900px', '360px', '查询', $('#myModalSearch'));
    });

    /** 保存 */

    $("#btnSure").click(function () {
        var InState = getTableCell(13);
        var acceptance_Id = getTableCell(14);
        var pt_Id = getTableCell(42);
        var In_Id = getTableCell(0);
        var acttualtax = getTableCell(9)*100;
        var Grsds = getTableCell(31)*100; //个人所得税
        var Fcs = getTableCell(30)*100; //房产税
        var InNumBer = $("#In_Number").val();
        if (InState != "未开发票" && InState != null && InState != "") {
            layer.msg("非正常流程，录入发票号失败！");
            return;
        }
        ZorPostSimpleData("/Base/UpdateInvoice", JSON.stringify({ 'Grsds': Grsds, 'Fcs': Fcs, 'InNumBer': InNumBer, 'accpid': acceptance_Id, 'pt_Id': pt_Id, 'In_Id': In_Id, 'acttualtax': acttualtax }), function (data) { //获取数据(带参数)
            layer.msg(data.AnswerMeg, function () {
                layer.closeAll();
                Replace();
            });
        })

    })

    /** 修改保存 */

    $("#btnSureUp").click(function () {
        var In_Id = getTableCell(0);
        var InState = getTableCell(13);
        var InNumBer = $("#In_Numbers").val();
        if (InState == "未开发票") {
            layer.msg("无需修改信息！");
            return;
        }
        ZorPostSimpleData("/Base/UpdateInvoiceNum", JSON.stringify({ 'InNumBer': InNumBer, 'In_Id': In_Id }), function (data) { //获取数据(带参数)
            layer.msg(data.AnswerMeg, function () {
                layer.closeAll();
                Replace();
            });
        })

    })
    /*** 录入发票号*/

    $("#btnInvoice").click(function () {

        var checkId = CheckboxValueIDs();
        if (checkId.length == 0) {
            layer.msg("请选择要录入发票号的信息！");                                                             //未选中任何行
            return;
        }
        if (checkId.length > 1) {
            layer.msg("只能选择一条要录入发票号的信息！");                                                             //未选中任何行
            return;
        }

        $("#Tenant_Name").val(getTableCell(3));
        $("#NatPer_Name").val(getTableCell(4));
        $("#Hs_Proportion").val(getTableCell(6));
        $("#Evaluate_Rent").val(getTableCell(7));
        $("#Lease_StartTime").val(getTableCell(23));
        $("#Lease_EndTime").val(getTableCell(24));
        LayerOpen('830px', '300px', '录入发票号', $('#myModal'));
    });


    /*** 录入发票号修改*/

    $("#btnUpdate").click(function () {

        var checkId = CheckboxValueIDs();
        if (checkId.length == 0) {
            layer.msg("请选择要编辑发票号的信息！");                                                             //未选中任何行
            return;
        }
        if (checkId.length > 1) {
            layer.msg("只能选择一条要编辑发票号的信息！");                                                             //未选中任何行
            return;
        }
        $("#In_Numbers").val(getTableCell(10));
        $("#Tenant_Names").val(getTableCell(3));
        $("#NatPer_Names").val(getTableCell(4));
        $("#Hs_Proportions").val(getTableCell(6));
        $("#Evaluate_Rents").val(getTableCell(7));
        $("#Lease_StartTimes").val(getTableCell(23));
        $("#Lease_EndTimes").val(getTableCell(24));
        LayerOpen('830px', '300px', '修改发票号', $('#myModalUp'));
    });
    /** 发票号详情*/

    $("#btnMessage").click(function () {
        var checkId = CheckboxValueIDs();
        if (checkId.length == 0) {
            layer.msg("请选择要查看录入发票号的信息！");
            return;
        }
        if (checkId.length > 1) {
            layer.msg("仅可选择一行查看的录入发票号信息！");
            return;
        }
        $("#Acceptance_TicketNumberD").html(getTableCell(2));
        $("#Tenant_NameD").html(getTableCell(3));
        $("#NatPer_NameD").html(getTableCell(4));
        $("#NatPer_PhoneD").html(getTableCell(5));
        $("#Hs_ProportionD").html(getTableCell(6));
        $("#Evaluate_RentD").html(getTableCell(7));
        $("#Pt_CertificateNumberD").html(getTableCell(8));
        $("#Evaluate_TaxD").html(getTableCell(9));
        $("#In_NumberD").html(getTableCell(10));
        $("#In_Date").html(getTableCell(11));
        $("#PtUserD").html(getTableCell(12));
        $("#Acceptance_IdD").html(getTableCell(14));
        $("#CommunityNameD").html(getTableCell(15));
        $("#NatPer_IDNumberD").html(getTableCell(16));
        $("#Acceptance_TaxNumberD").html(getTableCell(17));
        $("#Review_RentD").html(getTableCell(18));
        $("#Acceptance_AddressD").html(getTableCell(21));
        $("#Review_DateD").html(getTableCell(22));
        $("#Lease_StartTimeD").html(getTableCell(23));
        $("#Lease_EndTimeD").html(getTableCell(24));
        $("#Acceptance_TaxStartTimeD").html(getTableCell(26));
        $("#Acceptance_TaxEndTimeD").html(getTableCell(26));
        $("#Hs_attributeD").val(getTableCell(27));
        $("#Hs_CqsxD").val(getTableCell(28));
        $("#Lease_RentD").html(getTableCell(29));
        $("#Evaluate_PropertyTaxD").html(getTableCell(30));
        $("#Evaluate_PersonalTaxD").html(getTableCell(31));
        $("#Evaluate_TotalTaxD").html(getTableCell(32));
        $("#Review_CommentD").html(getTableCell(33));
        $("#ReviewUserD").html(getTableCell(34));
        $("#Evaluate_DateD").html(getTableCell(35));
        $("#Evaluate_CommentD").html(getTableCell(36));
        $("#Examine_CommentD").html(getTableCell(37));
        $("#EvaluateUserD").html(getTableCell(38));
        $("#Examine_DateD").html(getTableCell(39));
        $("#ExamineUserD").html(getTableCell(40));
        $("#Pt_ActualTaxD").html(getTableCell(41));
        $("#Pt_DateD").html(getTableCell(43));
        $("#InUser").html(getTableCell(44));
        LayerOpen('950px', '600px', '录入发票号详情', $('#myModalDetails'));
    })



</script>
